function C_setVideoOpts(ID,Trigger)

global CG;

if nargin<1 ID = 1; end

switch CG.Sessions.Video.Device
  case 'PointGrey';
    CG.Sessions.Video(ID).Source.TriggerDelayMode = 'Manual';
    CG.Sessions.Video(ID).Source.TriggerDelay = 0;
    CG.Sessions.Video(ID).Source.ShutterMode = 'Manual';
    CG.Sessions.Video(ID).Source.Shutter = 0.1;
    CG.Sessions.Video(ID).Source.ExposureMode = 'Manual';
    CG.Sessions.Video(ID).Source.Exposure = 1;
    CG.Sessions.Video(ID).Source.GainMode = 'Manual';
    CG.Sessions.Video(ID).Source.Gain =0;
    CG.Sessions.Video(ID).Source.FrameRatePercentageMode = 'Manual';
    CG.Sessions.Video(ID).Source.Strobe2Duration = 0.4; % TIME IN MS FOR OUTPUT
    CG.Sessions.Video(ID).Source.Strobe2Polarity = 'High'; % STROBE IS GOING HIGH TO INDICATE SIGNAL
    
    % SAMPLING RATE
    FRP = 100*CG.Sessions.Video(ID).SR/CG.Parameters.Video.PointGrey.SRMax;
    switch Trigger
      case 'internal';
        CG.Sessions.Video(ID).Source.FrameRatePercentage = FRP;
        triggerconfig(CG.Sessions.Video(ID).S,'manual','none','none');
        
      case 'external';
        set(get(CG.Sessions.Video(ID).S,'Source'),'FrameRatePercentage',100);
        if FRP < 80 % PRECISE CONTROL OVER FRAMERATE
          FramesPerTrigger = 1;
        else  % OPTMIZED FOR FAST IMAGING
          FramesPerTrigger = 50;
        end
        CG.Sessions.Video(ID).Source.TriggerParameter = FramesPerTrigger;
        triggerconfig(CG.Sessions.Video(ID).S,'hardware','risingEdge','externalTriggerMode15-Source0');
    end
    %CG.Sessions.Video(ID).Source.Strobe2 = 'off';
    CG.Sessions.Video(ID).SourceInstant.Strobe2 = 'off'; 
    CG.Sessions.Video(ID).Source.Strobe2 = 'on';

  case 'MacVideo';
    triggerconfig(CG.Sessions.Video(ID).S,'manual','none','none');
end
